
<?php $this->JQuery()->javascriptCaptureStart() ?>
jQuery(function() {
	$j('#object').change(function(){
		if($j('#object option:selected').val()!="Please Select"){
			if($j('#object option:selected').val()=="0"){				
				window.location = '/admin/sanity';
			}else{
				window.location = '/admin/sanity/list?object=' + $j('#object option:selected').val() + '<?php echo (!empty($_GET['errorz']) ? '&errorz='.$_GET['errorz'] : '');?>';
			}
		}
			
	});
	
	$j('#errors').change(function(){
		if($j('#errors option:selected').val()!="Please Select"){
			if($j('#errors option:selected').val()==""){				
				window.location = '/admin/sanity';
			}else{
				window.location = '/admin/sanity/list?errorz='+$j('#errors option:selected').val() + '<?php echo (!empty($_GET['object']) ? '&object='.$_GET['object'] : '');?>';
			}
		}
			
	});
});
<?php $this->JQuery()->javascriptCaptureEnd() ?>

<?php $this->headStyle()->captureStart()?>
    #content td { padding:5px}
    #content table { border:1px #aaa solid; padding:5px; width:100%}
    #content th {font-weight:bold;}
    #content .page a {padding:2px;}
<?php $this->headStyle()->captureEnd()?>

<form action="<?php echo $_SERVER["REQUEST_URI"]?>">
<?php

?>
Filter by Object: <select name="object" id="object">
	<option>Please Select</option>
	<option value="0">ALL</option>
	<option value="1">Boat</option>
	<option value="2">Car</option>
	<option value="3">Commercial</option>
	<option value="4">Maid</option>	
	<option value="5">Motorcycle</option>
	<option value="6">Residential</option>
</select>

Filter by Errors: <select name="errors" id="errors">
<?php 
$errors = $this->error_list;
foreach($errors as $item): ?>
	<option value="<?php $temp = array_keys($this->error_list, $item); echo $temp[0];?>"><?php echo $item;?></option>
<?php endforeach;?>
</select>
</form>
<table border="1" id="listings">
<?php
    $get = $_GET; unset($get['page']);
    $pagination = $this->pagination($this->listing_number, $this->page, $this->per_page, 4, $this->geturl('list', 'sanity', null, 'admin1', $get), (!empty($_GET['object']))?'&page=':'?page=');
?>
<?php if((int)$this->listing_number == 0):?>
	No errors founds!
<?php else:?>
    <tr>
        <th style="width:800px">
            Listing
        </th>
        <th>Type</th>
        <th>
            Number of errors
        </th>
   </tr>
    <?php foreach ($this->list as $item):?>
        <tr>
            <td>
                <a href="<?php echo $this->geturl('display', 'sanity', null, 'admin1', array('id'=> $item->_id))?>" target="_blank">
                    <?php echo $item->listing->title; ?>
                </a>
            </td>
            <td><?php echo $item->listing->_type[0]?></td>
            <td>
                <?php echo $item->error_count; ?>
            </td>
        </tr>
    <?php 
    endforeach; 
endif;
?>
</table>
<pre>
<?php print_r($item)?>
</pre>
<?php echo $pagination;?>